Skip to content

fix(app-shell): an app whose navigation holds only doc entries opens its first doc - #29769

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-0a0fzu
Nov 3, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-0a0fzu

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread
Fixes #29678

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:控制台打开一个应用的根地址时,若导航里没有对象、页面、仪表盘、报表或组件条目可落地,就打开成员能看到的第一个文档条目(应用内文档门户)。设计器预览里的“首页”提示同步这条规则。
  • 为什么改:导航只有文档条目的应用,打开后主区域一片空白,没有跳转也没有空状态,管理员、读者、外部成员都一样(QA run · studio-authoring-42-plus-2 (44/44) · 3482f3d8 · 2026-11-03 · 33 PASS / 3 PARTIAL / 7 FAIL / 1 BLOCKED / 0 NOT-RUN #29672 QA 实测,本 PR 现场复现)。
  • 风险与回滚:只在原来什么都不落地的情况下生效;第一条是文档、后面有对象的应用照旧落到第一个对象。文档的可读性由服务端把关:成员读不了的文档条目服务端已从导航里去掉,此时仍是“无权限”空状态。回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/console/AppContent.tsx 的 resolveLandingRoute(兜底顺序)与 findFirstRoute(类型集合参数化);ui/packages/app-shell/src/views/metadata-admin/previews/AppPreview.tsx 的 findFirstLanding。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/console/__tests__/AppContent.docOnlyLanding-29678.test.tsx,应见 7 个用例全绿:纯文档应用落到 /apps/APP/docs/BOOK,各对照组照旧。
  • 需要你做的:无,席位落地。

What changes

Claim: issuecomment 6593568853 (round 30), amended by 6593605696 (AppPreview parity).

An app whose navigation holds only doc entries opened /apps/APP to an empty main: findFirstRoute lands on object, page, dashboard, report and component entries only, and AppRootLanding rendered null when none landed.

  • AppContent.tsx: findFirstRoute takes the set of entry types it lands on (default: the five it always took). resolveLandingRoute is now: the declared landing, else the first working entry, else the first doc entry the member is shown (groups walked, url passed over). A doc entry's route is the one the sidebar follows, resolveHref's in-app docs portal (docs/BOOK[/DOC] under the app), which the console host mounts in its extraRoutes.
  • Docs are a last resort, not a tree-order peer: an app whose first entry is its manual, followed by working entries, still opens on its first working entry, as before and as the designer preview's existing pin states.
  • The doc is gated as a declared doc landing already is (Console: an app opens on the first landing entry whose visible predicate holds #28450): by the server's audience gate on the app read (it drops an unreadable doc entry) and on the doc read. The sidebar's own doc-readability answer (useNavDocTargetCheck) is NOT available to the landing without a new wait: it is a lazy doc/book list read that answers undefined (pass every entry) until it loads, so on the landing's first render it never has an answer. Measured live below: a doc behind a book the member may not read never reaches the landing, because the server already dropped its entry.
  • The pending-read hold (objectui#13097) is unchanged: both of its landing reads go through resolveLandingRoute, so a pending bound entry ahead of the doc still holds the skeleton.
  • AppPreview.tsx (amendment): findFirstLanding mirrors the runtime, so the designer preview names the first doc as the landing when nothing else lands.
  • The return null branch now covers only apps whose entries are all url/action links or live only under areas; its comment says so.

Tests

  • ui/packages/app-shell/src/console/__tests__/AppContent.docOnlyLanding-29678.test.tsx (7, harness as AppContent.landingWaitsReads-13097.test.tsx, with the host's docs route stubbed): a doc-only app lands on its first doc; a doc inside a group behind a url link; CONTROL first entry a doc then an object lands on the object; CONTROL object app redirects; CONTROL no navigation keeps AppNoAccessEmptyState; CONTROL a pending bound entry ahead of the doc holds the skeleton and lands on the bound entry when shown; the same pending entry failing lands on the doc.
  • AppPreview.docEntry-11197.test.tsx: one new case, a url + two doc entries names the first doc as the landing. The existing "→ Accounts" pin is unchanged and green.
Ablations (scripts/ablation-replace.mjs, mutation verified on disk, restored to HEAD with an empty git diff)
  • Drop the doc fallback in resolveLandingRoute: 3 failed / 4 passed (the two doc-only cases and the pending-then-fail case red; the four controls green).
  • Drop the doc pass in AppPreview: 1 failed / 3 passed (the new preview case red).
Sweep

Every ui test file importing AppContent or AppPreview (59 files, git grep -l), two locked batches at 2 workers, on the merged head e5ff194: 31/31 files 202 tests, 28/28 files 333 tests. The same 59 files were green on d8352d2 before the merge of main (30/30 201, 29/29 334). @object-ui/app-shell type-check exit 0 on e5ff194.

Acceptance notes

  • Live measurement (showcase --fresh backend, Vite console on this branch's source, 1440x900): package com.qa.r29678 with a published doc r29678_guide, a doc-only app r29678_help (one doc entry), a control app r29678_ctrl (one object entry), and r29678_locked_app whose only entry opens a book gated to a permission set nobody holds. Signed in as admin, as auditor.demo (reader) and as phone.demo (outsider):
    • before (AppContent.tsx from origin/main in the same running console): r29678_help stays at /apps/com.qa.r29678 with an empty main for all three;
    • after: all three land on /apps/com.qa.r29678/docs/com.qa.r29678/r29678_guide (the portal's canonical in-book URL) and read the doc;
    • control r29678_ctrl: /apps/r29678_ctrl/showcase_task in both legs, for all three;
    • r29678_locked_app: the server drops the unreadable entry, so all three get "Nothing in R29678 Locked is available to you yet" in both legs; nobody is sent to a refused doc page.
      Screenshots and the JSON readings are in the project files under issue-29678/shots/; the seat links them.
  • Not changed, reported to the seat as a finding: an app whose entries are all url/action links, or live only under areas, still opens to an empty main (measured live on this head: r29678_urlonly, one url entry, empty main for admin, reader and outsider).
  • ui/packages/app-shell/src/console/appServesNoNavigation.ts's docblock still lists doc among the entries the landing resolver never lands on. It is outside this card's file surface, so it is left for the seat.

Verification

Local, dispatch-gates --commands --repo objectstack-ai/objectstack derived 35 families on this diff: all 35 run, every one exit 0, --ran reconciliation 35 run, 0 NOT-MEASURED, 0 UNRUN (the ui vitest run scripts/ suite under the verify lock: 170 files / 4977 tests green). Re-run on the merged head e5ff194: all 35 again exit 0, --ran 35 run, 0 NOT-MEASURED, 0 UNRUN (ui vitest run scripts/ 170 files / 4977 tests). eslint on the four touched ui files: 0 errors. dispatch-gates --tier: no path-derived mandate. Changed lines 431 (under 3000). CI check-runs: see this PR.


Generated by Claude Code

…its first doc

The app root landed on object, page, dashboard, report and component
entries only and rendered nothing when none was shown, so a doc-only app
opened to an empty main. When no other entry lands, the root now opens
the first doc entry the member is shown, in the in-app docs portal. The
designer preview's landing mirror follows.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jRL46SawdHef859orD
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 3, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · zhuangjianguo · session_01QsR2jV4dWohojjbTJTQq5m

席位核对 · ACCEPT · 2026-11-03T04:14Z

Head-sha: e5ff19414856ada87a9054bc95d3a128f4b0a547

  • Shape: draft → main, Fixes #29678. 5 files, +405 / −31. No governed path: check-governed-merges --pr 29769 reports NOT governed. Clause-②: no and Metadata-protocol: none are line-initial in the body and in the changeset (patch for @object-ui/app-shell), as claimed in 6593568853 and amended in 6593605696.
  • Contract review: none owed (Clause-②: no). No export or string changes.
  • File surface: inside the claim as amended: console/AppContent.tsx, the new test AppContent.docOnlyLanding-29678.test.tsx, previews/AppPreview.tsx and one case in AppPreview.docEntry-11197.test.tsx (amendment 1), and the changeset.
  • Read in the diff:
    • findFirstRoute takes the set of landing types: WORKING_LANDING_TYPES (object, page, dashboard, report, component) by default, or DOC_LANDING_TYPES. Groups recurse with the same set.
    • resolveLandingRoute is now: declared landing, else the first working entry, else the first shown doc. A mixed app whose first entry is a doc still opens on its first working entry.
    • The skeleton's "pending reads still deciding" check calls the same resolveLandingRoute, so it moves with the new rung.
    • The removed if (item.type === 'url') continue; was redundant, because a url is in neither set and is not a group.
    • AppPreview.findFirstLanding(items, docs) runs the same two passes, so the designer names the landing the runtime opens.
    • The doc that lands is gated as a declared doc landing is (Console: an app opens on the first landing entry whose visible predicate holds #28450): by the server's audience gate, not by the sidebar's lazy doc-readability read. The dev measured that a doc behind an unheld book permission is dropped by the server, so the member gets AppNoAccessEmptyState and never a refused doc page.
  • Tests (dev):
    • 7 new runtime cases and 1 added designer case.
    • Ablations go red (3 of 7, and 1 of 4), and the CONTROLs stay green.
    • The 59-file AppContent / AppPreview sweep passes (535 of 535) at both heads, the type-check and ESLint report 0 errors, and 35 of 35 derived gates exit 0.
  • Measured (dev): live on showcase --fresh. Before, a doc-only app showed an empty main for admin, auditor.demo and phone.demo. After, all three land on /apps/com.qa.r29678/docs/com.qa.r29678/r29678_guide. The object-app CONTROL is unchanged. Shots: /mnt/project-files/issue-29678/shots/. Report: 6595131455.
  • Gates (check-runs on this head): 44 success, 11 skipped (opt-in and schedule gates), 0 failed, 0 pending.
  • Follow-up filed by the seat: console: an app whose navigation holds only url / action entries, or only areas, lands on a blank page #29771. A url/action-only app, or an areas-only app, still opens to an empty main, as measured on r29678_urlonly.
  • Landing: ordinary queue landing, pr_ready then automerge_enable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console: an app whose navigation holds only doc entries lands on a blank page, with no empty state

1 participant